package com.chen.seckill.service;

import com.chen.seckill.pojo.GoodsVO;
import com.chen.seckill.pojo.Order;
import com.baomidou.mybatisplus.extension.service.IService;
import com.chen.seckill.pojo.OrderDetailVo;
import com.chen.seckill.pojo.User;

/**
 * <p>
 *  服务类
 * </p>
 *
 * @author chenyuan
 * @since 2021-07-21
 */
public interface IOrderService extends IService<Order> {


    /**
     * 秒杀具体实现
     * @param user
     * @param goodsVO
     * @return
     */
    Order seckill(User user, GoodsVO goodsVO);

    /**
     * 查询订单详情信息
     * @param orderId
     * @return
     */
    OrderDetailVo detail(Long orderId);

    /**
     * 获取秒杀接口地址（主要是为了实现接口地址隐藏）
     * @param user
     * @param goodsId
     * @return
     */
    String createPath(User user, Long goodsId);

    /**
     * 校验秒杀地址
     * @param user
     * @param goodsId
     * @param path
     * @return
     */
    Boolean checkPath(User user, Long goodsId, String path);

    /**
     * 校验验证码
     * @param user
     * @param goodsId
     * @param captcha
     * @return
     */
    Boolean checkCaptcha(User user, Long goodsId, String captcha);
}
